/*
 * @Author: mark
 * @Date: 2023-05-04 09:30:48
 * @LastEditors: mark
 * @LastEditTime: 2023-07-12 14:38:22
 * @Description: file content
 */
import layout from '@/components/layout/index.vue';
import { createRouter, createWebHistory } from 'vue-router';
import { createPageGuard } from './guards';
import { App } from 'vue';
import { routes } from './routes';

export const router = createRouter({
  history: createWebHistory(),
  routes,
});

export function setupRouter(app: App<Element>) {
  app.use(router);
}

export function setupRouterGuard() {
  createPageGuard(router);
  // createPageLoadingGuard(router);
  // createHttpGuard(router);
  // createScrollGuard(router);
  // createMessageGuard(router);
  // createProgressGuard(router);
  // createPermissionGuard(router);
  // // must after createPermissionGuard (menu has been built.)
  // createParamMenuGuard(router);
  // createStateGuard(router);
}
